package thread.test_1;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Test3 implements Callable<String> {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        Test3 call = new Test3();
        FutureTask<String> ft = new FutureTask<>(call);
        Thread t = new Thread(ft);
        t.start();
        String s = ft.get();
        System.out.println(s);
    }

    @Override
    public String call() throws Exception {
        for (int i = 1; i <= 1001; i++) {
            System.out.println("想女神的第" + i + "夜");
        }
        return "🤦‍别在这理发店";
    }
}
